package com.aerotechnic.models;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

@Entity
@Table(name = "Ressource")
public class Ressource extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Column(name="NBR_Heures")
	private int nbHours;
	// la specialite
	@Column(name="Specialite")
	private String spec;
	// nombre des mecaniciens
	@Column(name="NBR_Mecanicien")
	private int nbMec;
	
	//***********************Links***************
	@OneToMany(fetch = FetchType.EAGER, targetEntity = Mecanicien.class)
	private Set<Mecanicien> mecaniciens = new HashSet<Mecanicien>(0);
	
	@OneToOne(fetch = FetchType.EAGER, targetEntity = JobCard.class)
	private JobCard jobCard;
	
	//getters and setters
	public int getNbHours() {
		return nbHours;
	}
	public void setNbHours(int nbHours) {
		this.nbHours = nbHours;
	}
	public String getSpec() {
		return spec;
	}
	public void setSpec(String spec) {
		this.spec = spec;
	}
	public int getNbMec() {
		return nbMec;
	}
	public void setNbMec(int nbMec) {
		this.nbMec = nbMec;
	}
	
	public Set<Mecanicien> getMecaniciens() {
		return mecaniciens;
	}
	public void setMecaniciens(Set<Mecanicien> mecaniciens) {
		this.mecaniciens = mecaniciens;
	}
	public JobCard getJobCard() {
		return jobCard;
	}
	public void setJobCard(JobCard jobCard) {
		this.jobCard = jobCard;
	}

}
